﻿<div class="text-center">
    <MSwitch @bind-Value="closeOnClick" Label="close on click"></MSwitch>

    <MMenu Top CloseOnClick="closeOnClick">
        <ActivatorContent>
            <MButton Color="primary" @attributes="@context.Attrs">DROPDOWN</MButton>
        </ActivatorContent>

        <ChildContent>
            <MList>
                @foreach (var item in items)
                {
                    <MListItem>
                        <MListItemContent>
                            <MListItemTitle>
                                @item
                            </MListItemTitle>
                        </MListItemContent>
                    </MListItem>
                }
            </MList>
        </ChildContent>
    </MMenu>
</div>

@code {

    [Inject]
    NavigationManager NavigationManager { get; set; }

    string[] items =
    {
        "Click Me",
        "Click Me",
        "Click Me",
        "Click Me 2"
    };

    bool closeOnClick = true;
}